package de.yellowshoes.tedx.helper;

import android.app.Activity;

import com.j256.ormlite.android.apptools.OpenHelperManager;

import de.yellowshoes.tedx.persistence.PersistenceHelper;

public class TEDxActivity extends Activity
    {
    private static PersistenceHelper db = null;

    @Override
    protected void onDestroy()
        {
        super.onDestroy();
        if( db != null )
            {
            OpenHelperManager.releaseHelper();
            db = null;
            }
        }

    protected PersistenceHelper getPersistenceHelper()
        {
        if( db == null )
            {
            db = OpenHelperManager.getHelper( getApplicationContext(), PersistenceHelper.class );
            }

        return db;
        }
    }
